package com.serviceImpl;

import java.util.List;

import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.dao.UserMapper;
import com.pojo.User;
import com.service.*;

@Service("userService")
public class UserServiceImpl implements IUserService {

	@Resource
	private UserMapper userDao;

	@Override
	public User getUserById(int id) {
		return this.userDao.selectByPrimaryKey(id);
	}

	@Override
	public void deleteById(int id) {
		this.userDao.deleteByPrimaryKey(id);
	}

	@Override
	public void insert(User user) {
		this.userDao.insert(user);
	}

	@Override
	public void insertSelective(User user) {
		this.userDao.insertSelective(user);
	}

	@Override
	public List<User> selectAll() {
		return this.userDao.selectAll();
	}

	@Override
	public int updateById(User user) {
		return this.userDao.updateByPrimaryKey(user);
	}

	@Override
	public int updateByIdSelective(User user) {
		return this.userDao.updateByPrimaryKeySelective(user);
	}

}
